from Model import Model

def frange(x, y, jump):
	while x < y:
		yield x
		x += jump
		

xfid = open('weaponDamage.txt', 'w')
xfid.close()

attributes={'imageFolder':'images','mapFolder':'maps','unitListFolder':'units','weaponListFolder':'weapons','screenWidth':'800','screenHeight':'600'}
model = Model(attributes['mapFolder'],attributes['unitListFolder'],attributes['weaponListFolder'])
print(model.weaponStrength)
print(model.defenses)
for weaponName,strength in model.weaponStrength.items():
	for unitName,defense in model.defenses.items():
		print(weaponName+" attacking "+unitName)
		fid = open('weaponDamage.txt', 'a')
		fid.write("\n\n"+weaponName+" attacking "+unitName+'\n\n')
		fid.close()
		for attackingHealth in frange(0.5,10.5,0.5):
			for defendingHealth in frange(0.5,10.5,0.5):
				model.calcDamage(strength, attackingHealth, defense, defendingHealth)